
json = require('json');

LoginProxy = { };

function LoginProxy.New(domain,sessionid)

      local proxyid = ProxyCreate(domain,1857,sessionid);
      local proxy = { _id = proxyid };
      local metatable = { __index = LoginProxy.Methods };
      setmetatable(proxy,metatable);
      return proxy;
end


function LoginProxy:Login(accountid,pswd,callback)

      local t = { accountid = accountid,pswd = pswd };
      local jsonstring = json.encode(t);
      local messageid = 121726959;
      ProxyCall2(self._id,messageid,jsonstring,callback);
end


LoginProxy.Methods = 
    {
      Login = LoginProxy.Login
    };